package com.xiaotu.mybatispro;

import org.apache.ibatis.annotations.InsertProvider;
import tk.mybatis.mapper.annotation.RegisterMapper;

import java.util.List;

/**
 * @author zhangxiao
 * @create 2022-03-03 14:29
 */
@RegisterMapper
public interface BatchInsertMapper<T> {

    /**
     * 批量保存实体，null的属性也会保存，不会使用数据库默认值
     *
     * @param record
     * @return
     */
    @InsertProvider(type = BatchInsertProvider.class, method = "dynamicSQL")
    int batchInsert(List<T> record);

}
